home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / AmigaTalk / system / DosFlags.st < prev    next >
Text File  |  2002-10-27  |  52KB  |  1,240 lines

  1. "----------------------------------------------------------------------"
  2. " I would prefer to have only one large Dictionary of all AmigaDOS     "
  3. " flags & tags, but since Little Smalltalk only uses 8-bit bytecodes,  "
  4. " a Dictionary is limitied to 256 entries, so I had to divide the flags"
  5. " into several smaller dictionaries.  You can use this one Class to    "
  6. " reference ALL the components using the getXX: methods (jts).         "
  7. " This Class is a Singleton-class.                                     "
  8. ""
  9. " ALL singleton classes MUST contain the following:                    "
  10. ""
  11. "   the methods:  isSingleton AND privateSetup     AND                 "
  12. "                 uniqueInstance Class instance variable.              "
  13. "----------------------------------------------------------------------"
  14.  
  15. Class DosSystem :Dictionary 
  16. ! uniqueInstance dateTime  aslFlags  exAllFlags dosFlags dosErrors dosPackets 
  17.   dosFHFlags     dosNotify dosRDArgs dosRecord  dosStdio dosVar    dosHunks
  18. !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newinstance !
  24.      newinstance <- super new.
  25.  
  26.      ^ newinstance
  27. |
  28.    new
  29.      ^ (self privateSetup)
  30. |
  31.    privateSetup
  32.      (uniqueInstance isNil)
  33.        ifTrue: [uniqueInstance <- self privateNew.
  34.  
  35.                 dateTime   <- DosDateTimeFlags new.
  36.                 aslFlags   <- DosASLFlags      new.
  37.                 exAllFlags <- DosExAllFlags    new.
  38.                 dosFlags   <- DosFlags         new.
  39.                 dosErrors  <- DosErrors        new.
  40.                 dosPackets <- DosPackets       new.
  41.                 dosFHFlags <- DosFH            new.
  42.                 dosNotify  <- DosNotifyFlags   new.
  43.                 dosRDArgs  <- DosRDArgsFlags   new.
  44.                 dosRecord  <- DosRecordFlags   new.
  45.                 dosStdio   <- DosStdIOFlags    new.
  46.                 dosVar     <- DosVarFlags      new.
  47.                 dosHunks   <- DosHunks         new.
  48.                ].
  49.                
  50.      ^ self    "or ^ uniqueInstance??"
  51. |
  52.    getDateTime: indexSymbol
  53.      ^ dateTime   at: indexSymbol
  54. |
  55.    getASLFlag: indexSymbol
  56.      ^ aslFlags   at: indexSymbol
  57. |
  58.    getExAllFlag: indexSymbol
  59.      ^ exAllFlags at: indexSymbol
  60. |
  61.    getDosFlag: indexSymbol
  62.      ^ dosFlags   at: indexSymbol
  63. |
  64.    getDosError: indexSymbol
  65.      ^ dosErrors  at: indexSymbol
  66. |
  67.    getDosPacket: indexSymbol
  68.      ^ dosPackets at: indexSymbol
  69. |
  70.    getDosFHFlag: indexSymbol
  71.      ^ dosFHFlags at: indexSymbol
  72. |
  73.    getDosNotify: indexSymbol
  74.      ^ dosNotify  at: indexSymbol
  75. |
  76.    getDosRDArg: indexSymbol
  77.      ^ dosRDArgs  at: indexSymbol
  78. |
  79.    getDosRecord: indexSymbol
  80.      ^ dosRecord  at: indexSymbol
  81. |
  82.    getDosStdio: indexSymbol
  83.      ^ dosStdio   at: indexSymbol
  84. |
  85.    getDosVar: indexSymbol
  86.      ^ dosVar     at: indexSymbol
  87. |
  88.    getDosHunk: indexSymbol
  89.      ^ dosHunks   at: indexSymbol
  90. ]
  91.  
  92. "----------------------------------------------------------------------"
  93. " DosASLFlags Class implements flags & tags used by the AmigaDOS       "
  94. " functions for AmigaTalk.  This class is a Singleton-class.           "
  95. ""
  96. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  97. " methods of this Class -- it's really getting hard to document each   "
  98. " AmigaTalk Class in two or more places!                               "
  99. ""
  100. "   EXAMPLE:  'myFlag <- dosSystem getASLFlag: #DDF_PatternBit'        "
  101. ""
  102. " ALL singleton classes MUST contain the following:                    "
  103. ""
  104. "   the methods:  isSingleton AND privateSetup     AND                 "
  105. "                 uniqueInstance Class instance variable.              "
  106. " ---------------------------------------------------------------------"
  107.  
  108. Class DosASLFlags :Dictionary ! uniqueInstance !
  109. [
  110.    isSingleton
  111.      ^ true  
  112. |  
  113.    privateNew ! newinstance !
  114.      newinstance <- super new.
  115.  
  116.      ^ newinstance
  117. |
  118.    new
  119.      ^ (self privateSetup)
  120. |
  121.    privateSetup
  122.      (uniqueInstance isNil)
  123.        ifTrue: [uniqueInstance <- self privateNew.
  124.  
  125.                 " dos/DosASL.h flags: "
  126.  
  127.                 self at: #APF_DOWILD         put: 1.   " User option ALL "
  128.                 self at: #APF_ITSWILD        put: 2.   " Set by MatchFirst, used by MatchNext "
  129.                 self at: #APF_DODIR          put: 4.   " Set if a Dir node should be entered "
  130.                 self at: #APF_DIDDIR         put: 8.   " Bit is SET for an 'expired' dir node "
  131.                 self at: #APF_NOMEMERR       put: 16.  " Set on memory error "
  132.                 self at: #APF_DODOT          put: 32.  " If set, allow conv'n of '.' toCurrentDir "
  133.                 self at: #APF_DirChanged     put: 64.  " an_Lock changed since last MatchNext call "
  134.                 self at: #APF_FollowHLinks   put: 128. " follow hardlinks on a DODIR. "
  135.  
  136.                 self at: #DDF_PatternBit     put: 1.
  137.                 self at: #DDF_ExaminedBit    put: 2.
  138.                 self at: #DDF_Completed      put: 4.
  139.                 self at: #DDF_AllBit         put: 8.
  140.                 self at: #DDF_Single         put: 16.
  141.  
  142.                 " Constants used by wildcard routines, these are the pre-parsed tokens
  143.                 * referred to by pattern match.  It is not necessary for you to do
  144.                 * anything about these, matchFirst: & matchNext handle all these for you.
  145.                 "
  146.                 self at: #P_ANY              put: 16r80. " Token for '*' or '#? "
  147.                 self at: #P_SINGLE           put: 16r81. " Token for '?' "
  148.                 self at: #P_ORSTART          put: 16r82. " Token for '(' "
  149.                 self at: #P_ORNEXT           put: 16r83. " Token for '|' "
  150.                 self at: #P_OREND            put: 16r84. " Token for ')' "
  151.                 self at: #P_NOT              put: 16r85. " Token for '~' "
  152.                 self at: #P_NOTEND           put: 16r86.
  153.                 self at: #P_NOTCLASS         put: 16r87. " Token for '^' "
  154.                 self at: #P_CLASS            put: 16r88. " Token for '[]' "
  155.                 self at: #P_REPBEG           put: 16r89. " Token for '[' "
  156.                 self at: #P_REPEND           put: 16r8A. " Token for ']' "
  157.                 self at: #P_STOP             put: 16r8B. " token to force end of evaluation "
  158.  
  159.                 " Values for an_Status, NOTE: These are the actual bit numbers: "
  160.  
  161.                 self at: #COMPLEX_BIT        put: 1.     " Parsing complex pattern "
  162.                 self at: #EXAMINE_BIT        put: 2.     " Searching directory "
  163.                ].
  164.                
  165.      ^ self    "or ^ uniqueInstance??"
  166. ]
  167.  
  168.  
  169. "----------------------------------------------------------------------"
  170. " DosExAllFlags Class implements exAll flags & tags used by the        "
  171. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  172. ""
  173. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  174. " methods of this Class -- it's really getting hard to document each   "
  175. " AmigaTalk Class in two or more places!                               "
  176. ""
  177. "   EXAMPLE:  'myFlag <- dosSystem getExAllFlag: #ED_NAME'             "
  178. ""
  179. " ALL singleton classes MUST contain the following:                    "
  180. ""
  181. "   the methods:  isSingleton AND privateSetup     AND                 "
  182. "                 uniqueInstance Class instance variable.              "
  183. " ---------------------------------------------------------------------"
  184.  
  185. Class DosExAllFlags :Dictionary ! uniqueInstance !
  186. [
  187.    isSingleton
  188.      ^ true  
  189. |  
  190.    privateNew ! newinstance !
  191.      newinstance <- super new.
  192.  
  193.      ^ newinstance
  194. |
  195.    new
  196.      ^ (self privateSetup)
  197. |
  198.    privateSetup
  199.      (uniqueInstance isNil)
  200.        ifTrue: [uniqueInstance <- self privateNew.
  201.  
  202.                 " dos/ExAll.h flags: "
  203.  
  204.                 " NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems
  205.                 * will return an error if passed ED_OWNER.  If you get ERROR_BAD_NUMBER,
  206.                 * retry with ED_COMMENT to get everything but owner info.  All filesystems
  207.                 * supporting ExAll() must support through ED_COMMENT, and must check Type
  208.                 * and return ERROR_BAD_NUMBER if they don't support the type.
  209.                 "
  210.  
  211.                 " values that can be passed for what data you want from ExAll()
  212.                 * each higher value includes those below it (numerically)
  213.                 * you MUST choose one of these values 
  214.                 "
  215.  
  216.                 self at: #ED_NAME        put: 1.
  217.                 self at: #ED_TYPE        put: 2. " Name and Type "
  218.                 self at: #ED_SIZE        put: 3. " Name, Type & Size "
  219.                 self at: #ED_PROTECTION  put: 4. " Name, Type, Size & Protection bits "
  220.                 self at: #ED_DATE        put: 5.
  221.                 self at: #ED_COMMENT     put: 6.
  222.                 self at: #ED_OWNER       put: 7. " The whole enchilada! "
  223.                ].
  224.                
  225.      ^ self    "or ^ uniqueInstance??"
  226. ]
  227.  
  228. "----------------------------------------------------------------------"
  229. " DosFlags Class implements Dos & DosExtens flags & tags used by the   "
  230. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  231. ""
  232. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  233. " methods of this Class -- it's really getting hard to document each   "
  234. " AmigaTalk Class in two or more places!                               "
  235. ""
  236. "   EXAMPLE:  'myFlag <- dosSystem getDosFlag: #SHARED_LOCK'           "
  237. ""
  238. " ALL singleton classes MUST contain the following:                    "
  239. ""
  240. "   the methods:  isSingleton AND privateSetup     AND                 "
  241. "                 uniqueInstance Class instance variable.              "
  242. " ---------------------------------------------------------------------"
  243.  
  244. Class DosFlags :Dictionary ! uniqueInstance !
  245. [
  246.    isSingleton
  247.      ^ true  
  248. |  
  249.    privateNew ! newinstance !
  250.      newinstance <- super new.
  251.  
  252.      ^ newinstance
  253. |
  254.    new
  255.      ^ (self privateSetup)
  256. |
  257.    privateInitializeDictionary      "Too big to be in a Block:"
  258.  
  259.      " dos/dos.h: flags: "
  260.  
  261.      self at: #DOSFALSE put:  0.
  262.      self at: #DOSTRUE  put: -1.
  263.  
  264.      self at: #MODE_OLDFILE     put: 1005. " Open existing file as read/write "
  265.      self at: #MODE_NEWFILE     put: 1006. " Open freshly created file read/write "
  266.      self at: #MODE_READWRITE   put: 1004. " Open old file w/shared lock "
  267.  
  268.      " Relative position to seekFile: "
  269.  
  270.      self at: #OFFSET_BEGINNING put: -1.      " relative to Beginning Of File "
  271.      self at: #OFFSET_CURRENT   put:  0.      " relative to Current file position "
  272.      self at: #OFFSET_END       put:  1.      " relative to End Of File "
  273.  
  274.      " Passed as type to lock: "
  275.  
  276.      self at: #SHARED_LOCK      put: -2.      " File is readable by others "
  277.      self at: #ACCESS_READ      put: -2.      " Synonym "
  278.      self at: #EXCLUSIVE_LOCK   put: -1.      " No other access allowed "
  279.      self at: #ACCESS_WRITE     put: -1.      " Synonym "
  280.  
  281.      self at: #TICKS_PER_SECOND put: 50.      " Number of ticks in one second "
  282.  
  283.      self at: #FIBF_OTR_READ    put: 16r8000. " Other: file is readable "
  284.      self at: #FIBF_OTR_WRITE   put: 16r4000. " Other: file is writable "
  285.      self at: #FIBF_OTR_EXECUTE put: 16r2000. " Other: file is executable "
  286.      self at: #FIBF_OTR_DELETE  put: 16r1000. " Other: prevent file from being deleted "
  287.      self at: #FIBF_GRP_READ    put: 16r800.  " Group: file is readable "
  288.      self at: #FIBF_GRP_WRITE   put: 16r400.  " Group: file is writable "
  289.      self at: #FIBF_GRP_EXECUTE put: 16r200.  " Group: file is executable "
  290.      self at: #FIBF_GRP_DELETE  put: 16r100.  " Group: prevent file from being deleted "
  291.      self at: #FIBF_HIDDEN      put: 16r80.   " file is hidden from casual scrutiny "
  292.      self at: #FIBF_SCRIPT      put: 16r40.   " file is a script (execute) file "
  293.      self at: #FIBF_PURE        put: 16r20.   " program is reentrant and rexecutable "
  294.      self at: #FIBF_ARCHIVE     put: 16r10.   " cleared whenever file is changed "
  295.      self at: #FIBF_READ        put: 8.       " File is readable "
  296.      self at: #FIBF_WRITE       put: 4.       " File is writeable "
  297.      self at: #FIBF_EXECUTE     put: 2.       " Executable by a Shell "
  298.      self at: #FIBF_DELETE      put: 1.       " prevent file from being deleted "
  299.  
  300.      self at: #FAULT_MAX        put: 82.      " Maximum length of falut string "
  301.  
  302.      " ID stands for InfoData, Disk States: "
  303.  
  304.      self at: #ID_WRITE_PROTECTED put: 80. " Disk is write protected "
  305.      self at: #ID_VALIDATING      put: 81. " Disk is currently being validated "
  306.      self at: #ID_VALIDATED       put: 82. " Disk is consistent and writeable "
  307.  
  308.      " Disk types: "
  309.  
  310.      self at: #ID_NO_DISK_PRESENT  put: -1.
  311.      self at: #ID_UNREADABLE_DISK  put: 16r42414400. " 'BAD\0' "
  312.      self at: #ID_DOS_DISK         put: 16r444F5300. " 'DOS\0' "
  313.      self at: #ID_FFS_DISK         put: 16r444F5301. " 'DOS\1' "
  314.      self at: #ID_INTER_DOS_DISK   put: 16r444F5302. " 'DOS\2' "
  315.      self at: #ID_INTER_FFS_DISK   put: 16r444F5303. " 'DOS\3' "
  316.      self at: #ID_FASTDIR_DOS_DISK put: 16r444F5304. " 'DOS\4' "
  317.      self at: #ID_FASTDIR_FFS_DISK put: 16r444F5305. " 'DOS\5' "
  318.      self at: #ID_NOT_REALLY_DOS   put: 16r4E444F53. " 'NDOS'  "
  319.      self at: #ID_KICKSTART_DISK   put: 16r4B49434B. " 'KICK'  "
  320.      self at: #ID_MSDOS_DISK       put: 16r4D534400. " 'MSD\0' "
  321.  
  322.      " setSignal( 0, 0 ) & SIGBREAKF_CTRL_C != false, then cleanup_and_exit() "
  323.  
  324.      self at: #SIGBREAKF_CTRL_C   put: 16r1000.
  325.      self at: #SIGBREAKF_CTRL_D   put: 16r2000.
  326.      self at: #SIGBREAKF_CTRL_E   put: 16r4000.
  327.      self at: #SIGBREAKF_CTRL_F   put: 16r8000.
  328.  
  329.      " Values returned by sameLock: "
  330.  
  331.      self at: #LOCK_DIFFERENT     put: -1.
  332.      self at: #LOCK_SAME          put: 0.
  333.      self at: #LOCK_SAME_VOLUME   put: 1. " locks are on same volume "
  334.  
  335.      " types for changeMode: "
  336.  
  337.      self at: #CHANGE_LOCK        put: 0.
  338.      self at: #CHANGE_FH          put: 1.
  339.  
  340.      " Values for makeLink: "
  341.  
  342.      self at: #LINK_HARD          put: 0.
  343.      self at: #LINK_SOFT          put: 1. " softlinks are not fully supported yet "
  344.  
  345.      " values returned by readItem: "
  346.  
  347.      self at: #ITEM_EQUAL         put: -2. " '=' Symbol "
  348.      self at: #ITEM_ERROR         put: -1. " error "
  349.      self at: #ITEM_NOTHING       put: 0.  " *N, ;, endstreamch "
  350.      self at: #ITEM_UNQUOTED      put: 1.  " unquoted item "
  351.      self at: #ITEM_QUOTED        put: 2.  " quoted item "
  352.  
  353.      " types for allocDosObject & freeDosObject: "
  354.  
  355.      self at: #DOS_FILEHANDLE     put: 0. " few people should use this "
  356.      self at: #DOS_EXALLCONTROL   put: 1. " Must be used to allocate exAllControl! "
  357.      self at: #DOS_FIB            put: 2. " For FileInfoBlock "
  358.      self at: #DOS_STDPKT         put: 3. " for doing packet-level I/O "
  359.      self at: #DOS_CLI            put: 4. " for shell-writers, etc "
  360.      self at: #DOS_RDARGS         put: 5. " for ReadArgs if you pass it in "
  361.  
  362.      " dos/DosExtens.h flags: "
  363.   
  364.      " Flags for process->pr_Flags "
  365.  
  366.      self at: #PRF_FREESEGLIST         put: 1.
  367.      self at: #PRF_FREECURRDIR         put: 2.
  368.      self at: #PRF_FREECLI             put: 4.
  369.      self at: #PRF_CLOSEINPUT          put: 8.
  370.      self at: #PRF_CLOSEOUTPUT         put: 16.
  371.      self at: #PRF_FREEARGS            put: 32.
  372.  
  373.      self at: #RNF_WILDSTAR            put: 16r1000000. " for rootNode"
  374.  
  375.      " Segment use codes: "
  376.  
  377.      self at: #CMD_SYSTEM              put: -1.
  378.      self at: #CMD_INTERNAL            put: -2.
  379.      self at: #CMD_DISABLED            put: -999.
  380.  
  381.      " definitions for dl_Type "
  382.  
  383.      self at: #DLT_DEVICE              put: 0.
  384.      self at: #DLT_DIRECTORY           put: 1.  " assign                "
  385.      self at: #DLT_VOLUME              put: 2.
  386.      self at: #DLT_LATE                put: 3.  " late-binding assign   "
  387.      self at: #DLT_NONBINDING          put: 4.  " non-binding assign    "
  388.      self at: #DLT_PRIVATE             put: -1. " for internal use only "
  389.  
  390.      " definitions for (DevProc structure) dvp_Flags "
  391.  
  392.      self at: #DVPF_UNLOCK             put: 1. " PRIVATE! "
  393.      self at: #DVPF_ASSIGN             put: 2.
  394.  
  395.      " Flags to be passed to lockDosList:, etc "
  396.  
  397.      self at: #LDF_DEVICES             put: 4.
  398.      self at: #LDF_VOLUMES             put: 8.
  399.      self at: #LDF_ASSIGNS             put: 16.
  400.      self at: #LDF_ENTRY               put: 32.
  401.      self at: #LDF_DELETE              put: 64.
  402.  
  403.      " you MUST specify one of LDF_READ or LDF_WRITE "
  404.      self at: #LDF_READ                put: 1.
  405.      self at: #LDF_WRITE               put: 2.
  406.  
  407.      " actually all but LDF_ENTRY (which is used for internal locking) "
  408.  
  409.      self at: #LDF_ALL                 put: 28. "LDF_DEVICES+LDF_VOLUMES+LDF_ASSIGNS"
  410.  
  411.      " error report types for ErrorReport() "
  412.  
  413.      self at: #REPORT_STREAM           put: 0.   " a stream "
  414.      self at: #REPORT_TASK             put: 1.   " a process - unused "
  415.      self at: #REPORT_LOCK             put: 2.   " a lock "
  416.      self at: #REPORT_VOLUME           put: 3.   " a volume node "
  417.      self at: #REPORT_INSERT           put: 4.   " please insert volume "
  418.  
  419.      " types for initial packets to shells from run/newcli/execute/system. "
  420.      " For shell-writers only "
  421.  
  422.      self at: #RUN_EXECUTE             put: -1.
  423.      self at: #RUN_SYSTEM              put: -2.
  424.      self at: #RUN_SYSTEM_ASYNCH       put: -3.
  425.  
  426.      " Types for fib_DirEntryType.   NOTE that both USERDIR and ROOT are
  427.      * directories, and that directory/file checks should use < 0 and >= 0.
  428.      * This is not necessarily exhaustive!   Some handlers may use other
  429.      * values as needed, though < 0 and >= 0 should remain as supported as
  430.      * possible.                         
  431.      "
  432.      self at: #ST_ROOT                 put: 1.
  433.      self at: #ST_USERDIR              put: 2.
  434.      self at: #ST_SOFTLINK             put: 3.  " looks like dir, but may point to a file! "
  435.      self at: #ST_LINKDIR              put: 4.  " hard link to dir "
  436.      self at: #ST_FILE                 put: -3. " must be negative for FIB! "
  437.      self at: #ST_LINKFILE             put: -4. " hard link to file "
  438.      self at: #ST_PIPEFILE             put: -5. " for pipes that support ExamineFH "
  439.  
  440.      " definitions for the System() call "
  441.  
  442.      self at: #SYS_Input        put: 16r80000021. " specifies the input filehandle "
  443.      self at: #SYS_Output       put: 16r80000022. " specifies the output filehandle "
  444.      self at: #SYS_Asynch       put: 16r80000023. " run asynch, close i/o on exit(!) "
  445.      self at: #SYS_UserShell    put: 16r80000024. " send to user shell instead of boot shell "
  446.      self at: #SYS_CustomShell  put: 16r80000025. " send to a specific shell (data is name) "
  447.  
  448.  
  449.      " definitions for the createNewProc: method.
  450.      * you MUST specify one of NP_Seglist or NP_Entry.  All else is optional. 
  451.      "
  452.      self at: #NP_Seglist       put: 16r80001001. " seglist of code to run for the process  "
  453.      self at: #NP_FreeSeglist   put: 16r80001002. " free seglist on exit - only valid for NP_Seglist.  Default is TRUE.      "
  454.      self at: #NP_Entry         put: 16r80001003. " entry point to run - mutually exclusive with NP_Seglist! "
  455.      self at: #NP_Input         put: 16r80001004. " filehandle - default is Open('NIL:'...) "
  456.      self at: #NP_Output        put: 16r80001005. " filehandle - default is Open('NIL:'...) "
  457.      self at: #NP_CloseInput    put: 16r80001006. " close input filehandle on exit default TRUE "
  458.      self at: #NP_CloseOutput   put: 16r80001007. " close output filehandle on exit default TRUE "
  459.      self at: #NP_Error         put: 16r80001008. " filehandle - default is Open('NIL:'...) "
  460.      self at: #NP_CloseError    put: 16r80001009. " close error filehandle on exit default TRUE "
  461.      self at: #NP_CurrentDir    put: 16r8000100A. " lock - default is parent's current dir  "
  462.      self at: #NP_StackSize     put: 16r8000100B. " stacksize for process - default 4000    "
  463.      self at: #NP_Name          put: 16r8000100C. " name for process - default 'New Process'"
  464.      self at: #NP_Priority      put: 16r8000100D. " priority - default same as parent      "
  465.      self at: #NP_ConsoleTask   put: 16r8000100E. " consoletask - default same as parent    "
  466.      self at: #NP_WindowPtr     put: 16r8000100F. " window ptr - default is same as parent  "
  467.      self at: #NP_HomeDir       put: 16r80001010. " home directory - default curr home dir  "
  468.      self at: #NP_CopyVars      put: 16r80001011. " boolean to copy local vars-default TRUE "
  469.      self at: #NP_Cli           put: 16r80001012. " create cli structure - default FALSE    "
  470.      self at: #NP_Path          put: 16r80001013. " path - default is copy of parents path  "
  471.                                                   " only valid if a cli process!      "
  472.      self at: #NP_CommandName   put: 16r80001014. " commandname - valid only for CLI      "
  473.      self at: #NP_Arguments     put: 16r80001015. " cstring of arguments - passed with str in a0, length in d0.   "
  474.  
  475.      self at: #NP_NotifyOnDeath put: 16r80001016. " notify parent on death - default FALSE  "
  476.      self at: #NP_Synchronous   put: 16r80001017. " don't return until process finishes -   "
  477.      self at: #NP_ExitCode      put: 16r80001018. " code to be called on process exit      "
  478.      self at: #NP_ExitData      put: 16r80001019. " optional argument for NP_EndCode rtn -  "
  479.  
  480.      " tags for AllocDosObject "
  481.  
  482.      self at: #ADO_FH_Mode      put: 16r80002001. " for type DOS_FILEHANDLE only! "
  483.                                                   " sets up FH for mode specified.
  484.                                                   * This can make a big difference for buffered
  485.                                                   * files.               
  486.                                                   "
  487.      " The following are for DOS_CLI.
  488.      * If you do not specify these, dos will use it's preferred values
  489.      * which may change from release to release.  The BPTRs to these
  490.      * will be set up correctly for you.  Everything will be zero,
  491.      * except cli_FailLevel (10) and cli_Background (DOSTRUE).
  492.      * NOTE:  You may also use these 4 tags with CreateNewProc.
  493.      "
  494.      self at: #ADO_DirLen       put: 16r80002002. " size in bytes for current dir buffer    "
  495.      self at: #ADO_CommNameLen  put: 16r80002003. " size in bytes for command name buffer   "
  496.      self at: #ADO_CommFileLen  put: 16r80002004. " size in bytes for command file buffer   "
  497.      self at: #ADO_PromptLen    put: 16r80002005  " size in bytes for the prompt buffer     "
  498. |
  499.    privateSetup
  500.      (uniqueInstance isNil)
  501.        ifTrue: [uniqueInstance <- self privateNew.
  502.  
  503.                 self privateInitializeDictionary
  504.                ].
  505.                
  506.      ^ self    "or ^ uniqueInstance??"
  507. ]
  508.  
  509. "----------------------------------------------------------------------"
  510. " DosErrors Class implements error number tags used by the AmigaDOS    "
  511. " functions for AmigaTalk.  This class is a Singleton-class.           "
  512. ""
  513. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  514. " methods of this Class -- it's really getting hard to document each   "
  515. " AmigaTalk Class in two or more places!                               "
  516. ""
  517. "   EXAMPLE:  'myFlag <- dosSystem getDosError: #ERROR_NO_FREE_STORE'  "
  518. ""
  519. " ALL singleton classes MUST contain the following:                    "
  520. ""
  521. "   the methods:  isSingleton AND privateSetup     AND                 "
  522. "                 uniqueInstance Class instance variable.              "
  523. " ---------------------------------------------------------------------"
  524.  
  525. Class DosErrors :Dictionary ! uniqueInstance !
  526. [
  527.    isSingleton
  528.      ^ true  
  529. |  
  530.    privateNew ! newinstance !
  531.      newinstance <- super new.
  532.  
  533.      ^ newinstance
  534. |
  535.    new
  536.      ^ (self privateSetup)
  537. |
  538.    privateInitializeDictionary      "Too big to be in a Block:"
  539.  
  540.      " Special error codes for ErrorReport() "
  541.  
  542.      self at: #ABORT_DISK_ERROR        put: 296.   " Read/write error "
  543.      self at: #ABORT_BUSY              put: 288.   " You MUST replace... "
  544.  
  545.      " Error codes from IoErr(), etc. "
  546.  
  547.      self at: #ERROR_NO_FREE_STORE            put: 103.
  548.      self at: #ERROR_TASK_TABLE_FULL          put: 105.
  549.      self at: #ERROR_BAD_TEMPLATE             put: 114.
  550.      self at: #ERROR_BAD_NUMBER               put: 115.
  551.      self at: #ERROR_REQUIRED_ARG_MISSING     put: 116.
  552.      self at: #ERROR_KEY_NEEDS_ARG            put: 117.
  553.      self at: #ERROR_TOO_MANY_ARGS            put: 118.
  554.      self at: #ERROR_UNMATCHED_QUOTES         put: 119.
  555.      self at: #ERROR_LINE_TOO_LONG            put: 120.
  556.      self at: #ERROR_FILE_NOT_OBJECT          put: 121.
  557.      self at: #ERROR_INVALID_RESIDENT_LIBRARY put: 122.
  558.      self at: #ERROR_NO_DEFAULT_DIR           put: 201.
  559.      self at: #ERROR_OBJECT_IN_USE            put: 202.
  560.      self at: #ERROR_OBJECT_EXISTS            put: 203.
  561.      self at: #ERROR_DIR_NOT_FOUND            put: 204.
  562.      self at: #ERROR_OBJECT_NOT_FOUND         put: 205.
  563.      self at: #ERROR_BAD_STREAM_NAME          put: 206.
  564.      self at: #ERROR_OBJECT_TOO_LARGE         put: 207.
  565.      self at: #ERROR_ACTION_NOT_KNOWN         put: 209.
  566.      self at: #ERROR_INVALID_COMPONENT_NAME   put: 210.
  567.      self at: #ERROR_INVALID_LOCK             put: 211.
  568.      self at: #ERROR_OBJECT_WRONG_TYPE        put: 212.
  569.      self at: #ERROR_DISK_NOT_VALIDATED       put: 213.
  570.      self at: #ERROR_DISK_WRITE_PROTECTED     put: 214.
  571.      self at: #ERROR_RENAME_ACROSS_DEVICES    put: 215.
  572.      self at: #ERROR_DIRECTORY_NOT_EMPTY      put: 216.
  573.      self at: #ERROR_TOO_MANY_LEVELS          put: 217.
  574.      self at: #ERROR_DEVICE_NOT_MOUNTED       put: 218.
  575.      self at: #ERROR_SEEK_ERROR               put: 219.
  576.      self at: #ERROR_COMMENT_TOO_BIG          put: 220.
  577.      self at: #ERROR_DISK_FULL                put: 221.
  578.      self at: #ERROR_DELETE_PROTECTED         put: 222.
  579.      self at: #ERROR_WRITE_PROTECTED          put: 223.
  580.      self at: #ERROR_READ_PROTECTED           put: 224.
  581.      self at: #ERROR_NOT_A_DOS_DISK           put: 225.
  582.      self at: #ERROR_NO_DISK                  put: 226.
  583.      self at: #ERROR_NO_MORE_ENTRIES          put: 232.
  584.      self at: #ERROR_IS_SOFT_LINK             put: 233.
  585.      self at: #ERROR_OBJECT_LINKED            put: 234.
  586.      self at: #ERROR_BAD_HUNK                 put: 235.
  587.      self at: #ERROR_NOT_IMPLEMENTED          put: 236.
  588.      self at: #ERROR_RECORD_NOT_LOCKED        put: 240.
  589.      self at: #ERROR_LOCK_COLLISION           put: 241.
  590.      self at: #ERROR_LOCK_TIMEOUT             put: 242.
  591.      self at: #ERROR_UNLOCK_ERROR             put: 243.
  592.  
  593.      " error codes 303-305 are defined in dosasl.h "
  594.  
  595.      " These are the return codes used by convention by AmigaDOS commands
  596.      * See FAILAT and IF for relevance to EXECUTE (script) files
  597.      "
  598.      self at: #RETURN_OK                      put: 0.  " No problems, success "
  599.      self at: #RETURN_WARN                    put: 5.  " A warning only "
  600.      self at: #RETURN_ERROR                   put: 10. " Something wrong "
  601.      self at: #RETURN_FAIL                    put: 20. " Complete or severe failure "
  602.  
  603.      " Returns from matchFirst: & matchNext:
  604.      * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  605.      * these are in the dos.h file.
  606.      "
  607.      self at: #ERROR_BUFFER_OVERFLOW   put: 303. " User or internal buffer overflow "
  608.      self at: #ERROR_BREAK             put: 304. " A break character was received "
  609.      self at: #ERROR_NOT_EXECUTABLE    put: 305  " A file has E bit cleared "
  610. |
  611.    privateSetup
  612.      (uniqueInstance isNil)
  613.        ifTrue: [uniqueInstance <- self privateNew.
  614.  
  615.                 self privateInitializeDictionary
  616.                ].
  617.                
  618.      ^ self    "or ^ uniqueInstance??"
  619. ]
  620.  
  621. "----------------------------------------------------------------------"
  622. " DosPackets Class implements flags & tags used by the AmigaDOS        "
  623. " functions for AmigaTalk.  This class is a Singleton-class.           "
  624. ""
  625. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  626. " methods of this Class -- it's really getting hard to document each   "
  627. " AmigaTalk Class in two or more places!                               "
  628. ""
  629. "   EXAMPLE:  'myFlag <- dosSystem getDosPacket: #ACTION_WRITE'        "
  630. ""
  631. " ALL singleton classes MUST contain the following:                    "
  632. ""
  633. "   the methods:  isSingleton AND privateSetup     AND                 "
  634. "                 uniqueInstance Class instance variable.              "
  635. " ---------------------------------------------------------------------"
  636.  
  637. Class DosPackets :Dictionary ! uniqueInstance !
  638. [
  639.    isSingleton
  640.      ^ true  
  641. |  
  642.    privateNew ! newinstance !
  643.      newinstance <- super new.
  644.  
  645.      ^ newinstance
  646. |
  647.    new
  648.      ^ (self privateSetup)
  649. |
  650.    privateInitializeDictionary      "Too big to be in a Block:"
  651.  
  652.      " Packet types "
  653.  
  654.      self at: #ACTION_NIL              put: 0.
  655.      self at: #ACTION_STARTUP          put: 0.
  656.      self at: #ACTION_GET_BLOCK        put: 2.   " OBSOLETE "
  657.      self at: #ACTION_SET_MAP          put: 4.
  658.      self at: #ACTION_DIE              put: 5.
  659.      self at: #ACTION_EVENT            put: 6.
  660.      self at: #ACTION_CURRENT_VOLUME   put: 7.
  661.      self at: #ACTION_LOCATE_OBJECT    put: 8.
  662.      self at: #ACTION_RENAME_DISK      put: 9.
  663.      self at: #ACTION_WRITE            put: 16r57. " 'W' "
  664.      self at: #ACTION_READ             put: 16r52. " 'R' "
  665.      self at: #ACTION_FREE_LOCK        put: 15.
  666.      self at: #ACTION_DELETE_OBJECT    put: 16.
  667.      self at: #ACTION_RENAME_OBJECT    put: 17.
  668.      self at: #ACTION_MORE_CACHE       put: 18.
  669.      self at: #ACTION_COPY_DIR         put: 19.
  670.      self at: #ACTION_WAIT_CHAR        put: 20.
  671.      self at: #ACTION_SET_PROTECT      put: 21.
  672.      self at: #ACTION_CREATE_DIR       put: 22.
  673.      self at: #ACTION_EXAMINE_OBJECT   put: 23.
  674.      self at: #ACTION_EXAMINE_NEXT     put: 24.
  675.      self at: #ACTION_DISK_INFO        put: 25.
  676.      self at: #ACTION_INFO             put: 26.
  677.      self at: #ACTION_FLUSH            put: 27.
  678.      self at: #ACTION_SET_COMMENT      put: 28.
  679.      self at: #ACTION_PARENT           put: 29.
  680.      self at: #ACTION_TIMER            put: 30.
  681.      self at: #ACTION_INHIBIT          put: 31.
  682.      self at: #ACTION_DISK_TYPE        put: 32.
  683.      self at: #ACTION_DISK_CHANGE      put: 33.
  684.      self at: #ACTION_SET_DATE         put: 34.
  685.  
  686.      self at: #ACTION_SCREEN_MODE      put: 994.
  687.  
  688.      self at: #ACTION_READ_RETURN      put: 1001.
  689.      self at: #ACTION_WRITE_RETURN     put: 1002.
  690.      self at: #ACTION_SEEK             put: 1008.
  691.      self at: #ACTION_FINDUPDATE       put: 1004.
  692.      self at: #ACTION_FINDINPUT        put: 1005.
  693.      self at: #ACTION_FINDOUTPUT       put: 1006.
  694.      self at: #ACTION_END              put: 1007.
  695.      self at: #ACTION_SET_FILE_SIZE    put: 1022.   " fast file system only in 1.3 "
  696.      self at: #ACTION_WRITE_PROTECT    put: 1023.   " fast file system only in 1.3 "
  697.  
  698.      self at: #ACTION_SAME_LOCK        put: 40.
  699.      self at: #ACTION_CHANGE_SIGNAL    put: 995.
  700.      self at: #ACTION_FORMAT           put: 1020.
  701.      self at: #ACTION_MAKE_LINK        put: 1021.
  702.      self at: #ACTION_READ_LINK        put: 1024.
  703.      self at: #ACTION_FH_FROM_LOCK     put: 1026.
  704.      self at: #ACTION_IS_FILESYSTEM    put: 1027.
  705.      self at: #ACTION_CHANGE_MODE      put: 1028.
  706.      self at: #ACTION_COPY_DIR_FH      put: 1030.
  707.      self at: #ACTION_PARENT_FH        put: 1031.
  708.      self at: #ACTION_EXAMINE_ALL      put: 1033.
  709.      self at: #ACTION_EXAMINE_FH       put: 1034.
  710.  
  711.      self at: #ACTION_LOCK_RECORD      put: 2008.
  712.      self at: #ACTION_FREE_RECORD      put: 2009.
  713.  
  714.      self at: #ACTION_ADD_NOTIFY       put: 4097.
  715.      self at: #ACTION_REMOVE_NOTIFY    put: 4098.
  716.  
  717.      " Added in V39: "
  718.  
  719.      self at: #ACTION_EXAMINE_ALL_END  put: 1035.
  720.      self at: #ACTION_SET_OWNER        put: 1036.
  721.  
  722.      " Tell a file system to serialize the current volume.  This is typically
  723.      * done by changing the creation date of the disk.  This packet does not 
  724.      * take any arguments.  
  725.      * NOTE:  Be prepared to handle failure of this packet for V37 ROM 
  726.      *        filesystems.
  727.      "
  728.      self at: #ACTION_SERIALIZE_DISK   put: 4200
  729. |
  730.    privateSetup
  731.      (uniqueInstance isNil)
  732.        ifTrue: [uniqueInstance <- self privateNew.
  733.  
  734.                 self privateInitializeDictionary
  735.                ].
  736.                
  737.      ^ self    "or ^ uniqueInstance??"
  738.  
  739. ]
  740.  
  741. "----------------------------------------------------------------------"
  742. " DosFH Class implements FileHandler flags & tags used by the AmigaDOS "
  743. " functions for AmigaTalk.  This class is a Singleton-class.           "
  744. ""
  745. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  746. " methods of this Class -- it's really getting hard to document each   "
  747. " AmigaTalk Class in two or more places!                               "
  748. ""
  749. "   EXAMPLE:  'myFlag <- dosSystem getDosFHFlag: #DE_INTERLEAVE'       "
  750. ""
  751. " ALL singleton classes MUST contain the following:                    "
  752. ""
  753. "   the methods:  isSingleton AND privateSetup     AND                 "
  754. "                 uniqueInstance Class instance variable.              "
  755. " ---------------------------------------------------------------------"
  756.  
  757. Class DosFH :Dictionary ! uniqueInstance !
  758. [
  759.    isSingleton
  760.      ^ true  
  761. |  
  762.    privateNew ! newinstance !
  763.      newinstance <- super new.
  764.  
  765.      ^ newinstance
  766. |
  767.    new
  768.      ^ (self privateSetup)
  769. |
  770.    privateSetup
  771.      (uniqueInstance isNil)
  772.        ifTrue: [uniqueInstance <- self privateNew.
  773.  
  774.                 " dos/FileHandler.h flags: "
  775.  
  776.                 " these are the offsets into the DiskEnvironment (struct DosEnvec) array 
  777.                 * DE_TABLESIZE is set to the number of longwords in the table minus 1 
  778.                 "
  779.                 self at: #DE_TABLESIZE    put: 0.  " minimum value is 11 (includes NumBuffers) "
  780.                 self at: #DE_SIZEBLOCK    put: 1.  " in longwords: standard value is 128 "
  781.                 self at: #DE_SECORG       put: 2.  " not used; must be 0 "
  782.                 self at: #DE_NUMHEADS     put: 3.  " # of heads (surfaces). drive specific "
  783.                 self at: #DE_SECSPERBLK   put: 4.  " not used; must be 1 "
  784.                 self at: #DE_BLKSPERTRACK put: 5.  " blocks per track. drive specific "
  785.                 self at: #DE_RESERVEDBLKS put: 6.  " unavailable blocks at start.    usually 2 "
  786.                 self at: #DE_PREFAC       put: 7.  " not used; must be 0 "
  787.                 self at: #DE_INTERLEAVE   put: 8.  " usually 0 "
  788.                 self at: #DE_LOWCYL       put: 9.  " starting cylinder. typically 0 "
  789.                 self at: #DE_UPPERCYL     put: 10. " max cylinder.  drive specific "
  790.                 self at: #DE_NUMBUFFERS   put: 11. " starting # of buffers.  typically 5 "
  791.                 self at: #DE_BUFMEMTYPE   put: 12. " type of mem to allocate for buffers.
  792.                                                    * 1 is public, 3 is chip, 5 is fast 
  793.                                                    "
  794.                 self at: #DE_MAXTRANSFER  put: 13. " Max number bytes to transfer at a time "
  795.                 self at: #DE_MASK         put: 14. " Address Mask to block out certain memory "
  796.                 self at: #DE_BOOTPRI      put: 15. " Boot priority for autoboot "
  797.                 self at: #DE_DOSTYPE      put: 16. " string showing filesystem type "
  798.                 self at: #DE_BAUD         put: 17. " Baud rate for serial handler "
  799.                 self at: #DE_CONTROL      put: 18. " Control word for handler/filesystem "
  800.                 self at: #DE_BOOTBLOCKS   put: 19. " Number of blocks containing boot code "
  801.                ].
  802.                
  803.      ^ self    "or ^ uniqueInstance??"
  804. ]
  805.  
  806. "----------------------------------------------------------------------"
  807. " DosNotifyFlags Class implements Notify flags & tags used by the      "
  808. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  809. ""
  810. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  811. " methods of this Class -- it's really getting hard to document each   "
  812. " AmigaTalk Class in two or more places!                               "
  813. ""
  814. "   EXAMPLE:  'myFlag <- dosSystem getDosNotify: #NOTIFY_CODE'         "
  815. ""
  816. " ALL singleton classes MUST contain the following:                    "
  817. ""
  818. "   the methods:  isSingleton AND privateSetup     AND                 "
  819. "                 uniqueInstance Class instance variable.              "
  820. " ---------------------------------------------------------------------"
  821.  
  822. Class DosNotifyFlags :Dictionary ! uniqueInstance !
  823. [
  824.    isSingleton
  825.      ^ true  
  826. |  
  827.    privateNew ! newinstance !
  828.      newinstance <- super new.
  829.  
  830.      ^ newinstance
  831. |
  832.    new
  833.      ^ (self privateSetup)
  834. |
  835.    privateSetup
  836.      (uniqueInstance isNil)
  837.        ifTrue: [uniqueInstance <- self privateNew.
  838.  
  839.                 " dos/Notify.h flags: "
  840.  
  841.                 " use of Class and code is discouraged for the time being - we might want to
  842.                 * change things 
  843.                 "
  844.                 self at: #NOTIFY_CLASS    put: 16r40000000. " NotifyMessage Class "
  845.                 self at: #NOTIFY_CODE     put: 16r1234. " NotifyMessage Codes "
  846.  
  847.                 " --- NotifyRequest Flags ------------------------------------------------ "
  848.  
  849.                 self at: #NRF_SEND_MESSAGE    put: 1.
  850.                 self at: #NRF_SEND_SIGNAL     put: 2.
  851.                 self at: #NRF_WAIT_REPLY      put: 8.
  852.                 self at: #NRF_NOTIFY_INITIAL  put: 16.
  853.  
  854.                 " do NOT set or remove NRF_MAGIC!  Only for use by handlers! "
  855.  
  856.                 self at: #NRF_MAGIC           put: 16r80000000.
  857.  
  858.                 " Flags reserved for private use by the handler: "
  859.  
  860.                 self at: #NR_HANDLER_FLAGS    put: 16rFFFF0000
  861.                ].
  862.                
  863.      ^ self    "or ^ uniqueInstance??"
  864. ]
  865.  
  866.  
  867. "----------------------------------------------------------------------"
  868. " DosRDArgsFlags Class implements RDArgs flags & tags used by the      "
  869. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  870. ""
  871. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  872. " methods of this Class -- it's really getting hard to document each   "
  873. " AmigaTalk Class in two or more places!                               "
  874. ""
  875. "   EXAMPLE:  'myFlag <- dosSystem getDosRDArg: #RDAF_STDIN'           "
  876. ""
  877. " ALL singleton classes MUST contain the following:                    "
  878. ""
  879. "   the methods:  isSingleton AND privateSetup     AND                 "
  880. "                 uniqueInstance Class instance variable.              "
  881. " ---------------------------------------------------------------------"
  882.  
  883. Class DosRDArgsFlags :Dictionary ! uniqueInstance !
  884. [
  885.    isSingleton
  886.      ^ true  
  887. |  
  888.    privateNew ! newinstance !
  889.      newinstance <- super new.
  890.  
  891.      ^ newinstance
  892. |
  893.    new
  894.      ^ (self privateSetup)
  895. |
  896.    privateSetup
  897.      (uniqueInstance isNil)
  898.        ifTrue: [uniqueInstance <- self privateNew.
  899.  
  900.                 " dos/RDArgs.h flags: "
  901.  
  902.                 self at: #RDAF_STDIN     put: 1.   " Use 'STDIN' rather than 'COMMAND LINE' "
  903.                 self at: #RDAF_NOALLOC   put: 2.   " If set, do not allocate extra string spc"
  904.                 self at: #RDAF_NOPROMPT  put: 4.   " Disable reprompting for string input. "
  905.  
  906.                 " Maximum number of template keywords which can be in a template passed
  907.                 * to ReadArgs(). IMPLEMENTOR NOTE - must be a multiple of 4.
  908.                 "
  909.                 self at: #MAX_TEMPLATE_ITEMS  put: 100.
  910.  
  911.                 " Maximum number of MULTIARG items returned by ReadArgs(), before
  912.                 * an ERROR_LINE_TOO_LONG.  These two limitations are due to stack
  913.                 * usage.  Applications should allow 'a lot' of stack to use ReadArgs().
  914.                 "
  915.                 self at: #MAX_MULTIARGS       put: 128
  916.                ].
  917.                
  918.      ^ self    "or ^ uniqueInstance??"
  919. ]
  920.  
  921. "----------------------------------------------------------------------"
  922. " DosRecordFlags Class implements Record flags & tags used by the      "
  923. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  924. ""
  925. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  926. " methods of this Class -- it's really getting hard to document each   "
  927. " AmigaTalk Class in two or more places!                               "
  928. ""
  929. "   EXAMPLE:  'myFlag <- dosSystem getDosRecord: #REC_SHARED'          "
  930. ""
  931. " ALL singleton classes MUST contain the following:                    "
  932. ""
  933. "   the methods:  isSingleton AND privateSetup     AND                 "
  934. "                 uniqueInstance Class instance variable.              "
  935. " ---------------------------------------------------------------------"
  936.  
  937. Class DosRecordFlags :Dictionary ! uniqueInstance !
  938. [
  939.    isSingleton
  940.      ^ true  
  941. |  
  942.    privateNew ! newinstance !
  943.      newinstance <- super new.
  944.  
  945.      ^ newinstance
  946. |
  947.    new
  948.      ^ (self privateSetup)
  949. |
  950.    privateSetup
  951.      (uniqueInstance isNil)
  952.        ifTrue: [uniqueInstance <- self privateNew.
  953.  
  954.                 " dos/Record.h flags: "
  955.  
  956.                 " Modes for lockRecord: & lockRecords: "
  957.  
  958.                 self at: #REC_EXCLUSIVE         put: 0.
  959.                 self at: #REC_EXCLUSIVE_IMMED   put: 1.
  960.                 self at: #REC_SHARED            put: 2.
  961.                 self at: #REC_SHARED_IMMED      put: 3.
  962.                ].
  963.                
  964.      ^ self    "or ^ uniqueInstance??"
  965. ]
  966.  
  967. "----------------------------------------------------------------------"
  968. " DosStdIOFlags Class implements stdio flags & tags used by the        "
  969. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  970. ""
  971. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  972. " methods of this Class -- it's really getting hard to document each   "
  973. " AmigaTalk Class in two or more places!                               "
  974. ""
  975. "   EXAMPLE:  'myFlag <- dosSystem getDosStdio: #BUF_LINE'             "
  976. ""
  977. " ALL singleton classes MUST contain the following:                    "
  978. ""
  979. "   the methods:  isSingleton AND privateSetup     AND                 "
  980. "                 uniqueInstance Class instance variable.              "
  981. " ---------------------------------------------------------------------"
  982.  
  983. Class DosStdIOFlags :Dictionary ! uniqueInstance !
  984. [
  985.    isSingleton
  986.      ^ true  
  987. |  
  988.    privateNew ! newinstance !
  989.      newinstance <- super new.
  990.  
  991.      ^ newinstance
  992. |
  993.    new
  994.      ^ (self privateSetup)
  995. |
  996.    privateSetup
  997.      (uniqueInstance isNil)
  998.        ifTrue: [uniqueInstance <- self privateNew.
  999.  
  1000.                 " dos/stdio.h flags: "
  1001.  
  1002.                 " types for SetVBuf "
  1003.  
  1004.                 self at: #BUF_LINE    put: 0.  " flush on \n, etc "
  1005.                 self at: #BUF_FULL    put: 1.  " never flush except when needed "
  1006.                 self at: #BUF_NONE    put: 2.  " no buffering "
  1007.            
  1008.                 self at: #ENDSTREAMCH put: -1. " EOF return value "
  1009.                ].
  1010.                
  1011.      ^ self    "or ^ uniqueInstance??"
  1012. ]
  1013.  
  1014.  
  1015. "----------------------------------------------------------------------"
  1016. " DosVarFlags Class implements variable flags & tags used by the       "
  1017. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  1018. ""
  1019. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1020. " methods of this Class -- it's really getting hard to document each   "
  1021. " AmigaTalk Class in two or more places!                               "
  1022. ""
  1023. "   EXAMPLE:  'myFlag <- dosSystem getDosVar: #LV_VAR'                 "
  1024. ""
  1025. " ALL singleton classes MUST contain the following:                    "
  1026. ""
  1027. "   the methods:  isSingleton AND privateSetup     AND                 "
  1028. "                 uniqueInstance Class instance variable.              "
  1029. " ---------------------------------------------------------------------"
  1030.  
  1031. Class DosVarFlags :Dictionary ! uniqueInstance !
  1032. [
  1033.    isSingleton
  1034.      ^ true  
  1035. |  
  1036.    privateNew ! newinstance !
  1037.      newinstance <- super new.
  1038.  
  1039.      ^ newinstance
  1040. |
  1041.    new
  1042.      ^ (self privateSetup)
  1043. |
  1044.    privateSetup
  1045.      (uniqueInstance isNil)
  1046.        ifTrue: [uniqueInstance <- self privateNew.
  1047.  
  1048.                 " dos/Var.h flags: "
  1049.  
  1050.                 " bit definitions for localVar->lv_Node.ln_Type: "
  1051.  
  1052.                 self at: #LV_VAR      put: 0.   " a  variable "
  1053.                 self at: #LV_ALIAS    put: 1.   " an alias "
  1054.  
  1055.                 " to be or'ed into type: "
  1056.  
  1057.                 self at: #LVB_IGNORE  put: 7.      " ignore this entry on GetVar, etc "
  1058.                 self at: #LVF_IGNORE  put: 16r80.
  1059.  
  1060.                 " definitions of flags passed to GetVar()/SetVar()/DeleteVar()
  1061.                 * bit defs to be OR'ed with the type:
  1062.                 * item will be treated as a single line of text unless BINARY_VAR is used 
  1063.                 "
  1064.                 self at: #GVF_GLOBAL_ONLY     put: 16r100.
  1065.                 self at: #GVF_LOCAL_ONLY      put: 16r200.
  1066.                 self at: #GVF_BINARY_VAR      put: 16r400.
  1067.                 self at: #GVF_DONT_NULL_TERM  put: 16r800. " only with GVF_BINARY_VAR "
  1068.  
  1069.                 " this is only supported in >= V39 dos.  V37 dos ignores this.
  1070.                 * this causes SetVar to affect ENVARC: as well as ENV:.   
  1071.                 "
  1072.                 self at: #GVF_SAVE_VAR        put: 16r1000. " only with GVF_GLOBAL_ONLY "
  1073.                ].
  1074.                
  1075.      ^ self    "or ^ uniqueInstance??"
  1076. ]
  1077.  
  1078. "----------------------------------------------------------------------"
  1079. " DosDateTimeFlags Class implements flags & tags used by the AmigaDOS  "
  1080. " functions for AmigaTalk.  This class is a Singleton-class.           "
  1081. ""
  1082. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1083. " methods of this Class -- it's really getting hard to document each   "
  1084. " AmigaTalk Class in two or more places!                               "
  1085. ""
  1086. "   EXAMPLE:  'myFlag <- dosSystem getDateTime: #FORMAT_DOS'           "
  1087. ""
  1088. " ALL singleton classes MUST contain the following:                    "
  1089. ""
  1090. "   the methods:  isSingleton AND privateSetup     AND                 "
  1091. "                 uniqueInstance Class instance variable.              "
  1092. " ---------------------------------------------------------------------"
  1093.  
  1094. Class DosDateTimeFlags :Dictionary ! uniqueInstance !
  1095. [
  1096.    isSingleton
  1097.      ^ true  
  1098. |  
  1099.    privateNew ! newinstance !
  1100.      newinstance <- super new.
  1101.  
  1102.      ^ newinstance
  1103. |
  1104.    new
  1105.      ^ (self privateSetup)
  1106. |
  1107.    privateSetup     
  1108.      (uniqueInstance isNil)
  1109.        ifTrue: [uniqueInstance <- self privateNew.
  1110.  
  1111.                 self at: #DTF_SUBST     put: 16r1.
  1112.                 self at: #DTF_FUTURE    put: 16r2.
  1113.                 self at: #FORMAT_DOS    put: 16r0.  " Date Formatting flags "
  1114.                 self at: #FORMAT_INT    put: 16r1.
  1115.                 self at: #FORMAT_USA    put: 16r2.
  1116.                 self at: #FORMAT_CDN    put: 16r3.
  1117.                 self at: #FORMAT_MAX    put: 16r3.
  1118.                 self at: #LEN_DATSTRING put: 16r10.
  1119.                ].
  1120.                
  1121.      ^ self    "or ^ uniqueInstance??"
  1122. ]
  1123.  
  1124. "----------------------------------------------------------------------"
  1125. " DosHunks Class implements hunk flags & tags used by the AmigaDOS     "
  1126. " functions for AmigaTalk.  This class is a Singleton-class.           "
  1127. ""
  1128. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1129. " methods of this Class -- it's really getting hard to document each   "
  1130. " AmigaTalk Class in two or more places!                               "
  1131. ""
  1132. "   EXAMPLE:  'myFlag <- dosSystem getDosHunk: #HUNK_NAME'             "
  1133. ""
  1134. " ALL singleton classes MUST contain the following:                    "
  1135. ""
  1136. "   the methods:  isSingleton AND privateSetup     AND                 "
  1137. "                 uniqueInstance Class instance variable.              "
  1138. " ---------------------------------------------------------------------"
  1139.  
  1140. Class DosHunks :Dictionary ! uniqueInstance !
  1141. [
  1142.    isSingleton
  1143.      ^ true  
  1144. |  
  1145.    privateNew ! newinstance !
  1146.      newinstance <- super new.
  1147.  
  1148.      ^ newinstance
  1149. |
  1150.    new
  1151.      ^ (self privateSetup)
  1152. |
  1153.    privateInitializeDictionary      "Too big to be in a Block:"
  1154.  
  1155.      " dos/DosHunks.h flags: (NOT Currently used 31-Dec-2001)"
  1156.      " hunk types "
  1157.  
  1158.      self at: #HUNK_UNIT               put: 999.
  1159.      self at: #HUNK_NAME               put: 1000.
  1160.      self at: #HUNK_CODE               put: 1001.
  1161.      self at: #HUNK_DATA               put: 1002.
  1162.      self at: #HUNK_BSS                put: 1003.
  1163.      self at: #HUNK_RELOC32            put: 1004.
  1164.      self at: #HUNK_ABSRELOC32         put: 1004.
  1165.      self at: #HUNK_RELOC16            put: 1005.
  1166.      self at: #HUNK_RELRELOC16         put: 1005.
  1167.      self at: #HUNK_RELOC8             put: 1006.
  1168.      self at: #HUNK_RELRELOC8          put: 1006.
  1169.      self at: #HUNK_EXT                put: 1007.
  1170.      self at: #HUNK_SYMBOL             put: 1008.
  1171.      self at: #HUNK_DEBUG              put: 1009.
  1172.      self at: #HUNK_END                put: 1010.
  1173.      self at: #HUNK_HEADER             put: 1011.
  1174.      self at: #HUNK_OVERLAY            put: 1013.
  1175.      self at: #HUNK_BREAK              put: 1014.
  1176.      self at: #HUNK_DREL32             put: 1015.
  1177.      self at: #HUNK_DREL16             put: 1016.
  1178.      self at: #HUNK_DREL8              put: 1017.
  1179.      self at: #HUNK_LIB                put: 1018.
  1180.      self at: #HUNK_INDEX              put: 1019.
  1181.  
  1182.      " Note: V37 loadSeg: uses 1015 (HUNK_DREL32) by mistake.  This will continue
  1183.      * to be supported in future versions, since HUNK_DREL32 is illegal in load files
  1184.      * anyways.  Future versions will support both 1015 and 1020, though anything
  1185.      * that should be usable under V37 should use 1015.
  1186.      "
  1187.      self at: #HUNK_RELOC32SHORT       put: 1020.
  1188.  
  1189.      " see ext_xxx below.  New for V39 (note that loadSeg: only handles RELRELOC32)."
  1190.      self at: #HUNK_RELRELOC32         put: 1021.
  1191.      self at: #HUNK_ABSRELOC16         put: 1022.
  1192.  
  1193.      " Any hunks that have the HUNKB_ADVISORY bit set will be ignored if they
  1194.      * aren't understood.  When ignored, they're treated like HUNK_DEBUG hunks.
  1195.      * NOTE: this handling of HUNKB_ADVISORY started as of V39 dos.library!  If
  1196.      * loading such executables is attempted under <V39 dos, it will fail with a
  1197.      * bad hunk type.
  1198.      "
  1199.      self at: #HUNKF_ADVISORY          put: 16r20000000.
  1200.      self at: #HUNKF_CHIP              put: 16r40000000.
  1201.      self at: #HUNKF_FAST              put: 16r80000000.
  1202.  
  1203.      " hunk_ext sub-types "
  1204.  
  1205.      self at: #EXT_SYMB                put: 0.   " symbol table "
  1206.      self at: #EXT_DEF                 put: 1.   " relocatable definition "
  1207.      self at: #EXT_ABS                 put: 2.   " Absolute definition "
  1208.      self at: #EXT_RES                 put: 3.   " no longer supported "
  1209.      self at: #EXT_REF32               put: 129. " 32 bit absolute reference to symbol "
  1210.      self at: #EXT_ABSREF32            put: 129.
  1211.      self at: #EXT_COMMON              put: 130. " 32 bit absolute reference to COMMON block "
  1212.      self at: #EXT_ABSCOMMON           put: 130.
  1213.      self at: #EXT_REF16               put: 131. " 16 bit PC-relative reference to symbol "
  1214.      self at: #EXT_RELREF16            put: 131.
  1215.      self at: #EXT_REF8                put: 132. "  8 bit PC-relative reference to symbol "
  1216.      self at: #EXT_RELREF8             put: 132.
  1217.      self at: #EXT_DEXT32              put: 133. " 32 bit data relative reference "
  1218.      self at: #EXT_DEXT16              put: 134. " 16 bit data relative reference "
  1219.      self at: #EXT_DEXT8               put: 135. "  8 bit data relative reference "
  1220.  
  1221.      " These are to support some of the '020 and up modes that are rarely used "
  1222.      self at: #EXT_RELREF32            put: 136. " 32 bit PC-relative reference to symbol "
  1223.      self at: #EXT_RELCOMMON           put: 137. " 32 bit PC-relative ref' to COMMON block "
  1224.  
  1225.      " for completeness... All 680x0's support this "
  1226.      self at: #EXT_ABSREF16            put: 138.   " 16 bit absolute reference to symbol "
  1227.  
  1228.      " this only exists on '020's and above, in the (d8,An,Xn) address mode "
  1229.      self at: #EXT_ABSREF8             put: 139    " 8 bit absolute reference to symbol "
  1230. |
  1231.    privateSetup
  1232.      (uniqueInstance isNil)
  1233.        ifTrue: [uniqueInstance <- self privateNew.
  1234.  
  1235.                 self privateInitializeDictionary
  1236.                ].
  1237.                
  1238.      ^ self    "or ^ uniqueInstance??"
  1239. ]
  1240.